//
//  ACAlarm.h
//  AlarmClock
//
//  Created by kai ren on 30/08/2011.
//  Copyright 2011 none. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ACAlarmEditController.h"

#define ALARM_ID			@"identifier"
#define ALARM_CREATE_DATE   @"createDate"
#define ALARM_FIRE_TIME		@"fireTime"
#define ALARM_IS_ACTIVE		@"isActive"
#define ALARM_TITLE			@"title"
#define ALARM_REPEAT		@"repeat"
#define ALARM_SOUND_NAME	@"soundName"

#define defaultSound		@"test.aif"

#define ALARM_NOTIFICATION_NUM      3
#define aDay				(60*60*24)

@class ACAlarmEditController;

@interface ACAlarm : NSObject {
	NSMutableArray *ownNotifications;
	
	NSString *alarmIdentifier;
	NSString *title;
	NSString *sondName;
	NSDate *createDate;
	NSDate *fireTime;
	
	BOOL isActive;
	int repeat;
	int index;
}

@property (retain) UILabel *lblTime;
@property (retain) UILabel *lblRepeat;
@property (retain) UILabel *lblTitle;
@property (retain) UISwitch *alarmSwitch;
@property (retain) NSString *alarmIdentifier;
@property (retain) NSString *title;
@property (retain) NSString *sondName;
@property (retain) NSDate *createDate;
@property (retain) NSDate *fireTime;
@property (assign) BOOL isActive;
@property (assign) int repeat;
@property (assign) int index;

/** Init a exist alarm 
 ** path: this alarm's record file path
 **/
- (id)initWithPath:(NSString *)path;

/** Add local notification for this alarm**/
- (void)addNotification;

/** Remove this alarm's all notification **/
- (void)removeNotication;

/** Get own notification**/
- (void)getOwnNotification;

/** Turn on or off this alarm **/
- (void)switchAlarm:(UISwitch *)sender;

/** Delete this alarm **/
- (void)deleteAlarm;

/** record alarm **/
- (void)writeInfo;

/** read alarm's info **/
- (void)readInfo:(NSString *)path;

/** snooze **/
- (void)snooze;

/** Stop the fire alarm **/
- (void)stopAlarm;

@end
